package fr.kotton.myorganizer.db;

import android.provider.BaseColumns;

public final class MyOrganizerDbContract {

    // To prevent someone from accidentally instantiating the contract class,
    // give it an empty constructor.
    public MyOrganizerDbContract() {
    }

    /* Inner class that defines the table contents */
    public static abstract class TaskEntry implements BaseColumns {
        public static final String TABLE_NAME = "task";
        public static final String COLUMN_NAME_TASK_ID = "task_id";
        public static final String COLUMN_NAME_TASK_TITLE = "title";
        public static final String COLUMN_NAME_TASK_ENDDATE = "enddate";
        public static final String COLUMN_NAME_TASK_FREQUENCYUNIT = "frequencyunit";
        // public static final String COLUMN_NAME_TASK_NOTIFICATION = "notification";
        public static final String COLUMN_NAME_TASK_REMINDERDELAY = "reminderdelay";
        // public static final String COLUMN_NAME_TASK_ALARM = "alarm";
        public static final String COLUMN_NAME_TASK_CONTENTTYPE = "contenttype";
        public static final String COLUMN_NAME_TASK_NULLABLE = null;
    }

    public static abstract class AppointmentEntry implements BaseColumns {
        public static final String TABLE_NAME = "appointment";
        public static final String COLUMN_NAME_APPOINTMENT_ID = "appointment_id";
        public static final String COLUMN_NAME_APPOINTMENT_TASK_ID = "task_id";
        public static final String COLUMN_NAME_APPOINTMENT_TYPE = "type";
        public static final String COLUMN_NAME_APPOINTMENT_STARTDATE = "startdate";
        public static final String COLUMN_NAME_APPOINTMENT_ADDRESS = "address";
    }

    public static abstract class TaskContentEntry implements BaseColumns {
        public static final String TABLE_NAME = "task_content";
        public static final String COLUMN_NAME_TASKCONTENT_ID = "taskcontent_id";
        public static final String COLUMN_NAME_TASKCONTENT_TASK_ID = "task_id"; // FK to TaskEntry
        public static final String COLUMN_NAME_TASKCONTENT_CHECK = "status";
        public static final String COLUMN_NAME_TASKCONTENT_CONTENT = "content";
    }

    public static abstract class ContactEntry implements BaseColumns {
        public static final String TABLE_NAME = "contact";
        public static final String COLUMN_NAME_CONTACT_ID = "contact_id";
        public static final String COLUMN_NAME_CONTACT_FIRSTNAME = "firstname";
        public static final String COLUMN_NAME_CONTACT_LASTNAME = "lastname";
    }

    public static abstract class PhoneNumberEntry implements BaseColumns {
        public static final String TABLE_NAME = "phone_number";
        public static final String COLUMN_NAME_PHONENUMBER_ID = "phonenumber_id";
        public static final String COLUMN_NAME_PHONENUMBER_TYPE = "type";
        public static final String COLUMN_NAME_PHONENUMBER_NUMBER = "number";
        public static final String COLUMN_NAME_PHONENUMBER_CONTACT_ID = "contact_id"; // FK to ContactEntry
    }

    public static abstract class EmailEntry implements BaseColumns {
        public static final String TABLE_NAME = "email";
        public static final String COLUMN_NAME_EMAIL_ID = "email_id";
        public static final String COLUMN_NAME_EMAIL_TYPE = "type";
        public static final String COLUMN_NAME_EMAIL_EMAIL = "email";
        public static final String COLUMN_NAME_EMAIL_CONTACT_ID = "contact_id"; // FK to ContactEntry
    }

    public static abstract class ContactGroupEntry implements BaseColumns {
        public static final String TABLE_NAME = "contact_group";
        public static final String COLUMN_NAME_CONTACTGROUP_ID = "contactgroup_id";
        public static final String COLUMN_NAME_CONTACTGROUP_NAME = "name";
        public static final String COLUMN_NAME_CONTACTGROUP_COLOR = "color";
    }

    public static abstract class TaskGroupEntry implements BaseColumns {
        public static final String TABLE_NAME = "task_group";
        public static final String COLUMN_NAME_TASKGROUP_ID = "taskgroup_id";
        public static final String COLUMN_NAME_TASKGROUP_NAME = "name";
        public static final String COLUMN_NAME_TASKGROUP_COLOR = "color";
    }

    public static abstract class ContactToContactGroupEntry implements BaseColumns {
        public static final String TABLE_NAME = "contact_to_contact_group";
        public static final String COLUMN_NAME_CONTACTTOCONTACTGROUP_GROUP_ID = "contactgroup_id"; // FK to ContactGroupEntry
        public static final String COLUMN_NAME_CONTACTTOCONTACTGROUP_CONTACT_ID = "contact_id"; // FK to AppointmentEntry
    }

    public static abstract class TaskToTaskGroupEntry implements BaseColumns {
        public static final String TABLE_NAME = "task_to_task_group";
        public static final String COLUMN_NAME_TASKTOTASKGROUP_TASK_ID = "task_id"; // FK to ContactGroupEntry
        public static final String COLUMN_NAME_TASKTOTASKGROUP_TASKGROUP_ID = "taskgroup_id"; // FK to AppointmentEntry
        public static final String COLUMN_NAME_TASKTOTASKGROUP_NULLABLE = null;
    }

    public static abstract class AppointmentToContactEntry implements BaseColumns {
        public static final String TABLE_NAME = "appointment_to_contact";
        public static final String COLUMN_NAME_APPOINTMENTTOCONTACT_APPOINTMENT_ID = "appointment_id"; // FK to ContactGroupEntry
        public static final String COLUMN_NAME_APPOINTMENTTOCONTACT_CONTACT_ID = "contact_id"; // FK to AppointmentEntry
    }
}
